from copy import deepcopy

class CueStack:
	
	def __init__(self, name):
		self.name = name
		self.cues = []
		self.currentCue = 0
		
	def addCuesToEnd(self, cue):
		self.cues.append(cue)
		
	def insertCues(self, cues, index):
		index = index
	
	def removeCuesByIndex(self, index):
		'hi'
		
	def goCue(self):
		self.cues[self.currentCue].goCue()
		self.currentCue += 1
		
class Cue:

	def __init__(self, name):
		self.name = name
		self.note = ""
		self.transitions = []
		
	def addTransitionToTop(self, transition):
		self.transitions.append(transition)
	
	def addTransition(transition, precedanceIndex):
		'hi'
	
	def addCueNote(self, note):
		self.note = note
	
	def save(self):
		#TODO: consolidateTransitions
		'hi'
	
	def goCue(self):
		#eventually will have to look in to timing in this section
		for transition in self.transitions:
			for property in transition.desiredSettings.properties:
				currentProperty = transition.fixtureOrGroup.getProperty(property.name).setValue(transition.desiredSettings.getProperty(property.name).getValue())

class Transition:

	def __init__(self, fixtureOrGroup, time):
		self.fixtureOrGroup = fixtureOrGroup
		self.desiredSettings = deepcopy(fixtureOrGroup.settings)
		self.time = time
		
#	def changeDesiredSettings(self, newDesiredSettings):
#		self.desiredSettings = newDesiredSettings
		
	def changeTime(self, newTime):
		self.time = newTime
		
	def changeFixtureOrGroup(self, newFixtureOrGroup):
		self.fixtureOrGroup = newFixtureOrGroup
		
	